import { reqAddressInfo, reqOrderInfo } from "@/api";
const state = {
  addressInfo: [],
  oderInfo: {}
};
const mutations = {
  GETUSERADDRESS(state, addressInfo) {
    state.addressInfo = addressInfo
  },
  GETODERINFO(state, oderInfo) {
    state.oderInfo = oderInfo
  }
};

const actions = {
  async getUserAddress({ commit }) {
    let result = await reqAddressInfo();
    if (result.code == 200) {

      commit('GETUSERADDRESS', result.data)
    }
  },
  async getOderInfo({ commit }) {
    let result = await reqOrderInfo();

    if (result.code == 200) {
      commit('GETODERINFO', result.data)
    }
  }
};
const getters = {

};
export default {
  namespaced: true,
  state,
  mutations,
  actions,
  getters,
}